<template>
  <div class="Custom-style">
    <div class="Custom-style-conetnt" :style="{ backgroundImage: `url(${publicUrls + 'free/style11/CustomBg.png'})` }">
      <div class="close-box" @click="store.setCustomDialogShow(false)">
        <i class="doorIcon">&#xe63d;</i>
      </div>
      <div class="Custom-style-left">
        <div class="title-box">
          <p>{{ style11data[store.childIndex].title }}</p>
        </div>
        <scrollBox
          color="#FFF"
          v-if="Scrollheights"
          :remarks="style11data[store.childIndex].description"
          :byid="11"
          :height="getScrollWComputed"
        >
          <template #solidBorder>
            <div class="solidBorder-child"></div>
          </template>
        </scrollBox>
      </div>
    </div>
    <div class="Custom-style--border"></div>
    <div class="IPimage">
      <div class="IPBox">
        <img :src="publicUrls + 'free/style11/IP.png'" alt="" class="IPImg" />
        <img :src="publicUrls + 'free/style11/IPhand.png'" alt="" class="IPhand" />
      </div>
    </div>
  </div>
</template> 

<script lang="ts">
export default defineComponent({
  name: 'style11',
});
</script>

<script setup lang="ts">
import { publicUrls } from '@/utils/minxin';
import scrollBox from '../scrollBox.vue';
import { useProjectStore } from '@/store';
import { ref, computed, defineComponent } from 'vue';
import style11data from '../data.js';
import { urls } from '@/utils/request/upload';

const store = useProjectStore();
let viewportHeight = window.innerHeight;
const Scrollheights = ref();
Scrollheights.value = (viewportHeight / 900) * 340;
const getScrollWComputed = computed(() => {
  if (store.isMobileType) {
    let rootNode = document.documentElement;

    // 获取计算后的样式
    let computedStyle = window.getComputedStyle(rootNode);

    // 读取字体大小（注意这里返回的可能是一个包含单位的字符串，如"16px"）
    let fontSize = computedStyle.fontSize;

    // 如果你需要一个数字值（不带单位）进行计算，你可能需要解析这个字符串
    // 例如，使用正则表达式或split()方法去除单位，并将结果转换为数字
    let fontSizeNumber = parseFloat(fontSize.replace(/[^0-9.-]/g, ''));
    // let heights = (fontSizeNumber / 144)
    let heights = (fontSizeNumber / 144) * 340;
    return heights;
  } else {
    return Scrollheights.value;
  }
});
</script>   

<style scoped lang="less">
.Custom-style {
  display: flex;
  flex-direction: column;
  position: relative;
  width: 100%;
  max-width: 800px;
  height: 480px;
  background: transparent;
  transform: translateZ(0px);
}
.Custom-style-conetnt {
  display: flex;
  width: 100%;
  height: 100%;
  background-repeat: repeat;
  background-size: 100% 100%;
  padding-top: 40px;
  border-radius: 30px;
  box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25);
}
.title-box {
  width: 100%;
  margin-bottom: 16px;
  ::v-deep p {
    color: #93bfd9;
    font-family: SourceHanSerifCN-Bold;
    font-size: 24px;
    line-height: 40px;
    text-align: center;
  }
}
.close-box {
  cursor: pointer;
  height: 32px;
  z-index: 30;
  position: absolute;
  top: 0;
  right: -30px;
  .doorIcon {
    font-size: 26px;
    color: #84aac0;
  }
}
.Custom-style-left {
  display: flex;
  flex-direction: column;
  align-items: start;
  flex: 1;
  padding-left: 50px;
  padding-right: 50px;
  height: 100%;
}

.IPimage {
  width: 125px;
  height: 120px;
  position: absolute;
  bottom: 0;
  left: -90px;
  z-index: 666;
  // animation: ip-anim 3s linear infinite;
  .IPBox {
    width: 100%;
    height: 100%;
    position: relative;
    .IPImg {
      width: 125px;
      height: 121px;
    }
    .IPhand {
      width: 43px;
      height: 46px;
      position: absolute;
      left: -34px;
      top: 50%;
      transform-origin: right center;
      animation: ip-rotate 2s linear infinite;
    }
  }
}

@keyframes ip-rotate {
  0% {
    transform: translateY(-50%) rotate(0deg);
  }
  50% {
    transform: translateY(-50%) rotate(20deg);
  }
  100% {
    transform: translateY(-50%) rotate(0deg);
  }
}

.solidBorder-child {
  width: 2px;
  height: 100%;
  background: rgba(132, 170, 192, 0.4);
  border-radius: 1px;
  opacity: 0.4;
}
::v-deep .scrollBar {
  width: 4px;
  height: 100%;
  background: #84aac0;
  border-radius: 2px;
}
::v-deep .templatestyle1-scroll-box-tumb {
  align-items: center;
  justify-content: center;
}
::v-deep {
  .solid-box-parent {
    width: 32px;
  }
  .unit-exbi-remarks-info-remarks {
    width: calc(100% - 32px);
  }
}
</style>
